﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="true"
    CodeFile="Categoria.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="Server">
    
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="id" DataSourceID="SqlDataSource1" GridLines="None" 
        PageSize="3">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="id" 
                DataNavigateUrlFormatString="../ViewProduto.aspx?id={0}" DataTextField="nome" />
            <asp:BoundField DataField="nome" SortExpression="nome" />
            <asp:BoundField DataField="preco" SortExpression="preco" />
            <asp:ImageField DataImageUrlField="miniatura">
            </asp:ImageField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT [id], [nome], [preco], [miniatura], [categoria] FROM [produto] WHERE ([categoria] = @categoria)">
        <SelectParameters>
            <asp:QueryStringParameter Name="categoria" QueryStringField="categoria" />
        </SelectParameters>
    </asp:SqlDataSource>
    
</asp:Content>
